<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Unibox</title>

<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/animate.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" href="css/bootstrap.min.css">
<link href="css/animate.css" rel="stylesheet" type="text/css">

<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="project/js/globals.js"></script>
<script src="project/js/index.js"></script>

<style>
	 tbody tr:hover
	 {
	 	color:blue;
	 	cursor:pointer;
	 }
</style>

</head>
<body>
	<%@ page import="it.unisa.unibox.beans.Account"%>
	<%
		Account ac = (Account) session.getAttribute("account");
		if (ac != null) {
			response.sendRedirect("home.jsp");
		}
	%>
	<div class="main">
		<div class="page">
			<div class="header">
				<div class="header_message"></div>
			</div>
			<div class="topmenu">
				<form class="home_login" id="login_form" action="./login" method="POST">
					<ul>
					<li class="topmenu_item" style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; padding-left: 0px;">
						<input type="text" style="background: none center ; color:#FFF" class="input-small" data-toggle="tooltip" placeholder="Username" id="username" name="username" /></li>
					<li class="topmenu_item" ><input type="password" style="background: none center ; color:#FFF" class="input-small" placeholder="Password" id="password" name="password" /></li>
					<li class="topmenu_item" ><a onclick="login()"><button class="btn">Login</button></a></li>	
					<li class="topmenu_item" ><a href="#"><input type="checkbox" /> Ricordami</a></li>
					</ul>
				</form>
			</div>
			<!--HEADER-->

	
			<div class="content"> <!--DIV PRINCIPALE-->

<div id="center_div" class="row-fluid offset2"><!--Body  cambiare l'offset x la posizione-->

	<h3>Ricerca dei prodotti </h3>
	<form name="form_ricerca_prodotto" id="formricerca" method="post" action="./ricercaProdotto"> <!--Inserire l'action!!!-->	
 	

	<div class="row-fluid">	
	<div class="span2" ><label class="control-label" for="prodotto_tipologia">Tipologia di prodotto</label> 
	</div>
    	
	   	<div class="controls span2">
		      	<select data-toggle="tooltip" id="prodotto_tipologia" name="prodotto_tipologia">
			<optgroup label="Tipologia" >
			<option value="" ></option>
			<option>Articolo Rivista</option>
			<option>Articolo Libro</option>
			<option>Monografia</option>
			<option>Atti Congresso</option>
			<option>Brevetto</option>
			<option>Curatela</option>
			<option>Altro</option>
			</optgroup>
		      	</select>
		</div>
	</div>

	<div class="row-fluid">		
		<div class="span2">
			
  			<label>Anno Pubblicazione</label>
		</div>
		<div class="span6">	
			Da
	    		<select id="annoDa" style="width:91px" name="annoDa" onChange="cambiaAnno(this.value)"> 
			<option value="" ></option>
				
			</select>
	
			a
	    		<select id="annoA" style="width:91px" name="annoA"> 
	    	<option value="" ></option>
				
			</select>
		</div>
	</div>	



	<div class="row-fluid">	
		<div class="span2">
    		<label class="control-label" for="prodotto_titolo">Titolo prodotto</label>
    		</div>
		<div class="controls span2">
      		<input data-toggle="tooltip" type="text" id="prodotto_titolo" name="prodotto_titolo">
      		<span class="help-inline"></span> 
		</div>
	</div>
	
	<div class="accordion" id="accordion2">
	  <div class="accordion-group span6">
	    <div class="accordion-heading">
     		 <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
        		Avanzate
       		 </a>
    	   </div>
    	   <div id="collapseOne" class="accordion-body collapse"> <!--Se si aggiunge "in" dopo collapse sarà aperta di default-->   
              <div class="accordion-inner">
	  	<!--PARTE NASCOSTA :P !!!-->      
	
	        <div class="row-fluid">	
		  <div class="span2">
    		    <label class="control-label" for="nome">Nome</label>
    		  </div>
		  <div class="controls span2 offset1">
      		    <input data-toggle="tooltip" type="text" id="nome" name="nome">
      		    <span class="help-inline"></span> 
		  </div>
	       </div>

	<div class="row-fluid">	
		<div class="span2">
    		<label class="control-label" for="cognome">Cognome</label>
    		</div>
		<div class="controls span2 offset1">
      		<input data-toggle="tooltip" type="text" id="cognome" name="cognome">
      		<span class="help-inline"></span> 
		</div>
	</div>

	<div class="row-fluid">	
		<div class="span2">
    		<label class="control-label" for="cod_fiscale">Codice Fiscale</label>
    		</div>
		<div class="controls span2 offset1">
      		<input data-toggle="tooltip" type="text" id="cod_fiscale" name="cod_fiscale" >
      		<span class="help-inline"></span> 
		</div>
	</div>
	
	<div class="row-fluid">	
		<div class="span2" ><label class="control-label" for="dipartimento">Dipartimento</label> 
		</div>
    	
   		<div class="controls span2 offset1">
	      		<select data-toggle="tooltip" id="dipartimento" name="dipartimento">
			<option value="" ></option>
			</select>
		</div>
	</div>
		<div class="row-fluid">	
			<div class="span2" ><label class="control-label" for="area">Area Scientifica</label> 
			</div>
	    	
	   		<div class="controls span2 offset1">
		      		<select data-toggle="tooltip" id="area" name="area">
		
				<option value="" ></option>
		
		      		</select>
			</div>
		</div>
	</div>
    	</div>
  	</div>
  	</div>
	<div class="row-fluid">
		<div class="span2 offset1">
		
			<a  onClick="ricercaProdotti()"role="button" class="btn btn-success" data-toggle="modal">&nbsp;Cerca&nbsp;</a>
			
		
		
		<br> </br>
			<a href="#conferma_annulla" role="button"class="btn btn-danger" data-toggle="modal">Annulla</a>
		</div>				
		
		
	</div>	
	<div class="row-fluid">		
		<div class="span2">
			
  			<label>Ordina per:</label>
		</div>
		<div class="span6">	
	<select data-toggle="tooltip" onChange="ricercaProdotti()" id="ordine" name="ordine">
		
				<option value="titolo" >Titolo</option>
				<option value="anno" >Anno</option>
				<option value="responsabile" >Responsabile</option>
				<option value="tipologia" >Tipologia</option>
		
		      	</select>
		  </div>
	</div>
	</form>
	
 
	
</div><!--fine body-->

<div class="row-fluid">
						<div class="span8 offset2">


							<table id="result" class="table" border=2 >
								<!-- Tabella prodotti -->
								<thead id=intestazione>
									
								</thead>
								<tbody id="listaProdotti">
								<!-- IL CONTENUTO DINAMICO DELLA TABELLA SI AGGIUNGE QUI -->
								
								</tbody>
							
								
							</table>
						</div>


</div>
				 

				<div class="footer">
					<!--FOOTER-->
					<!--DO NOT Remove The Footer Links-->
					<img src="images/footnote.gif" class="copyright"
						alt="html templates"></a>
					<p>
						&copy; Copyright 2010. Designed by <a class="footer-link"
							target="_blank" >Unibox Studio</a>
						<!--DO NOT Remove The Footer Links-->
					</p>
				</div>
				<!--Chiusura DIV FOOTER-->


	<a id=cerca href="#param_ricerca"  style="visibility:hidden" data-toggle="modal"></a>
	
	<a id=login_errato href="#param_login"  style="visibility:hidden" data-toggle="modal"></a>
	<a id=nessunRisultatoButton href="#nessun_risultato"  style="visibility:hidden" data-toggle="modal"></a>
	
			</div>
			<!--DIV PRINCIPALE-->





  
<!--DIV ANNULLA-->      
<div id="conferma_annulla" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h4 id="myModalLabel">Annulla Operazione</h4>
  </div>
  <div class="modal-body">
    <p>Sei sicuro di voler annullare l'operazione ?(I dati di ricerca saranno cancellati)</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Annulla</button>
    <button class="btn btn-danger" onClick="resetForm('#formricerca')"  data-dismiss="modal">Conferma </button>
  </div>
</div><!--DIV ANNULLA-->     
		
		
<!--DIV INSERISCI ALMENO UN CAMPO DI RICERCA-->      
<div id="param_ricerca" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h4 id="myModalLabel">Campi ricerca</h4>
  </div>
  <div class="modal-body">
    <p>Inserisci almeno un parametro di ricerca!</p>
  </div>
  <div class="modal-footer">
    <button class="btn btn-danger" data-dismiss="modal">Conferma </button>
  </div>
</div><!--DIV INSERISCI ALMENO UN CAMPO DI RICERCA-->      

		
<!--DIV LOGIN ERRATO-->      
<div id="param_login" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h4 id="myModalLabel">Dati errati</h4>
  </div>
  <div class="modal-body">
    <p>I dati inseriti non sono validi o non sono associati ad alcun account registrato</p>
  </div>
  <div class="modal-footer">
    <button class="btn btn-danger" data-dismiss="modal">Chiudi</button>
  </div>
</div><!--DIV LOGIN ERRATO-->   

<!--DIV NESSUN RISULTATO RICERCA-->      
<div id="nessun_risultato" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h4 id="myModalLabel">Ricerca eseguita</h4>
  </div>
  <div class="modal-body">
    <p>Non &egrave stato trovato nessun prodotto che risponde ai parametri specificati.</p>
  </div>
  <div class="modal-footer">
    <button class="btn btn-success" data-dismiss="modal">Conferma </button>
  </div>
</div><!--DIV ANNULLA-->

</body>
</html>